﻿
namespace EmbeddedWebserver.Core.Configuration
{
    public sealed class EmbeddedWebapplicationConfiguration : IEmbeddedWebapplicationConfiguration
    {
        #region Non-public members

        private static string _path;
        private static ushort _port;
        private static ushort _maxWorkerThreadCount;
        private static bool _enableDirectoryBrowsing;
        private static bool _requestFilterModuleEnabled;
        private static string _requestFilterModuleAllowMask;

        #endregion

        #region Public members

        public string Path
        {
            get { return _path; }
            set
            {
                _path = value;
            }
        }

        public ushort Port
        {
            get { return _port; }
            set
            {
                _port = value;
            }
        }

        public ushort MaxWorkerThreadCount
        {
            get { return _maxWorkerThreadCount; }
            set
            {
                _maxWorkerThreadCount = value;
            }
        }

        public bool EnableDirectoryBrowsing
        {
            get { return _enableDirectoryBrowsing; }
            set { _enableDirectoryBrowsing = value; }
        }
        public bool RequestFilterModuleEnabled
        {
            get { return _requestFilterModuleEnabled; }
            set { _requestFilterModuleEnabled = value; }
        }

        public string RequestFilterModuleAllowMask
        {
            get { return _requestFilterModuleAllowMask; }
            set { _requestFilterModuleAllowMask = value; }
        }

        #endregion

        #region Constructors

        public EmbeddedWebapplicationConfiguration()
        { }

        public EmbeddedWebapplicationConfiguration(string root)
        {
            Path = root;
            EnableDirectoryBrowsing = false;
            RequestFilterModuleEnabled = false;
            RequestFilterModuleAllowMask = "";
        }

        #endregion
    }
}